package milkproduction.to;

public class ContainerTO {
	private int containerNo;
	private String stockedDate;
	private int quantity;
	private String supplier;
	
	public ContainerTO (){}

	public ContainerTO(int containerNo, String stockedDate, int quantity,
			String supplier) {
		super();
		this.containerNo = containerNo;
		this.stockedDate = stockedDate;
		this.quantity = quantity;
		this.supplier = supplier;
	}

	public int getContainerNo() {
		return containerNo;
	}

	public void setContainerNo(int containerNo) {
		this.containerNo = containerNo;
	}

	public String getStockedDate() {
		return stockedDate;
	}

	public void setStockedDate(String stockedDate) {
		this.stockedDate = stockedDate;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public String getSupplier() {
		return supplier;
	}

	public void setSupplier(String supplier) {
		this.supplier = supplier;
	}

	@Override
	public String toString() {
		return "ContainerTO [containerNo=" + containerNo + ", stockedDate="
				+ stockedDate + ", quantity=" + quantity + ", supplier="
				+ supplier + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + containerNo;
		result = prime * result + quantity;
		result = prime * result
				+ ((stockedDate == null) ? 0 : stockedDate.hashCode());
		result = prime * result
				+ ((supplier == null) ? 0 : supplier.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContainerTO other = (ContainerTO) obj;
		if (containerNo != other.containerNo)
			return false;
		if (quantity != other.quantity)
			return false;
		if (stockedDate == null) {
			if (other.stockedDate != null)
				return false;
		} else if (!stockedDate.equals(other.stockedDate))
			return false;
		if (supplier == null) {
			if (other.supplier != null)
				return false;
		} else if (!supplier.equals(other.supplier))
			return false;
		return true;
	}

}
